<?php

namespace common\models;

use Yii;
use yii\base\Model;

class LoginForm extends Model
{
    public $mobile;
    public $pwd;
    public $isRemember;
    public $referrer;   //来源页面地址
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['mobile',  'pwd'], 'required'],
            ['mobile', 'trim'],
            ['referrer', 'safe'],//来源页面地址
            ['pwd', 'string', 'min' => 6,'message'=>'密码长度必须大于6位'],
            ['pwd', 'string', 'max'=>16,'message'=>'密码长度必须小于16位'],
        ];
    }
}
